home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / CC_C / 0574.ZIP / IOCTL.ASM < prev    next >
Assembly Source File  |  1986-08-03  |  442b  |  32 lines

  1. include compiler.inc
  2.     ttl    IOCTL, 1.03, 08-03-86 clr
  3.  
  4. ;low-level io control
  5.  
  6.     dseg
  7.     exterr
  8.  
  9.     cseg
  10.  
  11.     procdef    ioctl, <<handl, word>, <flag, word>>
  12.  
  13.     xor    ax,ax
  14.     moverr    ax
  15.     mov    bx,handl    ;handle
  16.     mov    dx,flag        ;flag
  17.     or    dx,dx
  18.     jz    doit        ;read the bits
  19.     inc    al        ;set the bits
  20.     xor    dh,dh
  21. doit:    mov    ah,44h
  22.     int    21h
  23.     jnb    ex
  24.     moverr    ax    ;if error save it
  25.     mov    dx,-1        ;and return EOF
  26. ex:    mov    ax,dx
  27.     pret
  28.  
  29.     pend    ioctl
  30.  
  31.     finish
  32.